<template>
<el-dialog
      :visible.sync="dialogTableVisible"
      :close-on-click-modal="false"
      width="50%">
         <el-form>
      <el-form-item label="选择月份">
        <el-date-picker
          v-model="changeMonth"
          @change="getMonthprice"
          type="month"
          size="small"
          format="yyyy-MM"
          value-format="yyyy-MM"
         :placeholder='month.planMonth'
        ></el-date-picker>
      </el-form-item>
    </el-form>
     <el-table :data='price' style="width:100%;text-aligin:center;line-height:auto" border>
      <el-table-column  align="center" label="费用项目名称"   property="costProName" :show-overflow-tooltip="true"  ></el-table-column>
      <el-table-column align="center" label=" 总费用"   property="remaining" :show-overflow-tooltip="true"  ></el-table-column>
      <el-table-column  align="center" label="已经使用的费用"   property="sun" :show-overflow-tooltip="true"  ></el-table-column>
      <el-table-column align="center" label="剩余费用"  property="use"  ></el-table-column>
     </el-table>
</el-dialog>
</template>

<script>
import request from '@/utils/request'
export default {
    name: 'priceMX',
    props: ['month'],
    data () {
        return {
            dialogTableVisible:true,
            changeMonth:'',
            price:[]
        }
    },
    created () {
        // debugger
        console.log('接受',this.month)
        this.getPrice()
    },
    methods:{
//获取价格信息
      getPrice () {
        // console.log(this.queryParams.planMonth)
        request({
          url:'/system/demandPlan/remainingBudget/?mouth='+this.month.planMonth,
          method: 'get'
        }).then(response =>{
          console.log(response)
          this.price = response.data
        //   this.$emit('callback',this,price)
        })
      },
      getMonthprice () {
          console.log(this.changeMonth)
        // console.log(this.queryParams.planMonth)
        request({
          url:'/system/demandPlan/remainingBudget/?mouth='+this.changeMonth,
          method: 'get'
        }).then(response =>{
          console.log(response)
          this.price = response.data
        //   this.$emit('callback',this,price)
        })
      },
    }
}
</script>